/*
 * Copyright (c)	2010	Bo Zhou<Bo.Schwarzstein@gmail.com>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 
		http://www.apache.org/licenses/LICENSE-2.0 
 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#pragma once

#include <maya/MFnMeshData.h>
#include <maya/MPxDeformerNode.h>

/** \brief Child Deformer Node in Maya
 * 
 */
class MeshRelaxationDeformer : public MPxDeformerNode
{
public:
	static  void* Creator();
	static  MStatus Initialize();

	//! Self-defined id which is used by Maya internally.
	static MTypeId Identifier;

	//! Attribute for choosing relexation method .
	static MObject AttrMethod;
	//! Iteration times.
	static MObject AttrTime;
	//! Whether it shows progress window when it's working.
	static MObject AttrShowProgress;
	//! Whether use the painted vertex colors.
	static MObject AttrUsePaintedVertices;
	//! Painted color.
	static MObject AttrPaintedColor;

	//! Used by Laplacian algorithm, also Taubin.
	static MObject AttrLambda;
	//! Used by Taubin's method only, second order Laplacian smoothing.
	static MObject AttrMu;
	//! Equal, Fuji
	static MObject AttrWeightMethod;

	//! Used by Bilateral algorithm.
	static MObject AttrSigmaC;
	//! Used by Bilateral algorithm.
	static MObject AttrSigmaS;

	MeshRelaxationDeformer();
	virtual ~MeshRelaxationDeformer();

	//! Override Maya's default methods.
	MStatus compute(const MPlug& plug, MDataBlock& dataBlock);
	void setModifiedCallback(MSelectionList & list, bool listAdded);
};
